﻿@using OA.Core
@using OA.Model
@using OA.Core.Helper
@{
    Layout = null;
    BaseConfig config = ViewBag.BaseConfig;

}
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>@ViewBag.Title--@config.SiteName</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="renderer" content="webkit" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="apple-mobile-web-app-title" content="@config.SiteName" />
    <link rel="icon" type="image/png" href="@config.OssUrl/front/i/favicon.ico" />
    <link rel="stylesheet" href="@config.OssUrl/front/css/admin.css" />
    <link rel="stylesheet" href="@config.OssUrl/front/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="@config.OssUrl/front/font/iconfont.css" />
    <script type="text/javascript" src="@config.OssUrl/admin/js/jquery-3.4.1.min.js"></script>
    <script type="text/javascript" src="@config.OssUrl/front/layui/layui.js"></script>
    <style type="text/css">
        #LAY_ucm {
            padding: 7px 0;
            background-color: #fcfcfc;
        }

            #LAY_ucm .layui-form-item {
                margin: 0px;
            }
    </style>
</head>
<body style="min-width:1000px;">
    @{
        string msg = ViewBag.Prompt;
        string tips = string.Empty;
        if (!string.IsNullOrWhiteSpace(msg))
        {
            tips = $"layer.msg('{msg}');";
        }
    }
    <script type="text/javascript">
        layui.use(['layer'], function () {
            if ("@tips"!= "") {
                layer.msg("@tips");
            }
        });
        function ShowPage(url, title, index) {
            var area = ['90%', '90%'];//宽高
            if (index != undefined && index>0) {
                var height = 120 + 53 * index;
                area = ['90%', height+'px'];
            }
            console.log(area);
            layer.open({
                type: 2,
                title: title,
                shadeClose: false,
                shade: 0.3,
                area: area,
                content: url
            });
        }
        function RefreshResultList() {
            if ($(".layui-laypage-btn").length > 0) {
                $(".layui-laypage-btn")[0].click();
                layer.closeAll();
            }
            else {
                $(".searchButton").click();
            }
        }
    </script>
    <div class="fly-panel-user" style="padding:4px 4px 0 4px;">
        @RenderBody()
    </div>
    <script>
        layui.config({
            base: '@config.OssUrl/admin/layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use('index');

        layui.use(['table','laydate', 'element'], function () {
            var table = layui.table;
            var laydate = layui.laydate;
            var dateCotrol = $(".mydate");
            if (dateCotrol.length > 0) {
                $.each(dateCotrol, function () {
                    var controlID = $(this).prop("id");
                    var type = $(this).attr("data-type");
                    if (controlID != undefined && controlID != null) {
                        laydate.render({
                            elem: '#' + controlID,
                            type: type
                        });
                    }
                });
            }

            $(".searchButton").click(function () {
                var paramArray = $(this).parents("form").serializeArray();
                var jsonObj = {};
                $(paramArray).each(function () {
                    jsonObj[this.name] = this.value;
                });
                table.reload("resultList", {
                    page: {
                        curr: 1
                    }
                    , where: jsonObj
                });
            });
        });

    </script>

</body>
</html>
